import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import space.xxhui.DAO.UserMapper;
import space.xxhui.POJO.User;

public class UserDAOTest2 {
	@Test
	public void testDB() {
		BeanFactory beanFactory = new ClassPathXmlApplicationContext("spring/spring-orm.xml");
		UserMapper userDao = (UserMapper) beanFactory.getBean("userDao");
		User user = userDao.getUserById(1);
		System.out.println(user.toString());
		User user1 = userDao.getUserByIdForAnnotation(2);
		if(user1==null) {
			System.out.println("data is null ,return");
			return;
		}
		System.out.println(user1.toString());
	}
}
